#include "stdafx.h"
#include "neuron.h"
#include "input_neuron.h"
#include "bias_unit.h"

namespace nnse
{
	extern io_module io_m;

	// Constructor and Destructor

	template <class T, class U> bias_unit<T, U>::bias_unit(layer<T, U>^ p, unsigned int n_n)
	: input_neuron<T, U>(p, n_n)
	{
		io_m.startup_stream << "Constructing bias unit " << get_number() << std::endl;
	}

	template <class T, class U> bias_unit<T, U>::~bias_unit()
	{
		io_m.startup_stream << "Destructing bias unit " << get_number() << std::endl;
	}

	// Worker Functions

	template <class T, class U> U bias_unit<T, U>::calc_NET()
	{
		return 1.0;
	}

	// Serialisation Functions

	template <class T, class U> void bias_unit<T, U>::display(std::wofstream& out)
	{
		out << "Bias Unit:" << std::endl;
		neuron<T, U>::display(out);
	}

	// Explicit Instantiation

	template ref class bias_unit<bool, double>;
	template ref class bias_unit<unsigned char, double>;
}
